package lyj.springcloud.myselfblockhandler;

import com.alibaba.csp.sentinel.slots.block.BlockException;
import com.lyj.springcloud.entities.CommonResult;

/**
 * 自定义全局限流处理逻辑
 */
public class CustomBlockHandler {

    /**
     * 1，改方法必须是静态的
     * 2，必须携带业务方法中所有的参数
     * 3，必须携带参数 BlockException
     * @param e
     * @return
     */
    public static CommonResult myselfHandle1(String id,BlockException e) {
        return new CommonResult( "自定义限流逻辑 myselfHandle1 id : " + id );
    }

    public static CommonResult myselfHandle2(String id,BlockException e) {
        return new CommonResult( "自定义限流逻辑 myselfHandle2 id : " + id );
    }
}
